﻿<BaseUI:UserControlBase
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:BaseUI="clr-namespace:Silverlight.Weblog.Client.Default.Widgets.BaseUI" 
    xmlns:local="clr-namespace:Silverlight.Weblog.Client.Default.Widgets" 
    xmlns:Commands="clr-namespace:Microsoft.Practices.Composite.Presentation.Commands;assembly=Microsoft.Practices.Composite.Presentation" mc:Ignorable="d"
	xmlns:layoutPrimitivesToolkit="clr-namespace:System.Windows.Controls.Primitives;assembly=System.Windows.Controls.Layout.Toolkit" xmlns:VSM="clr-namespace:Silverlight.Weblog.Client.CoreBL.VSM;assembly=Silverlight.Weblog.Client.DAL" xmlns:MultipleBlogPostsContentWidget="clr-namespace:Silverlight.Weblog.Client.Default.Widgets.MultipleBlogPostsContentWidget" xmlns:System="clr-namespace:System;assembly=mscorlib" xmlns:layoutToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Layout.Toolkit" x:Class="Silverlight.Weblog.Client.Default.Widgets.MultiBlogPostItem"
	d:DesignWidth="640" d:DesignHeight="480"
    VSM:VisualStateSetter.State="{Binding VSMState}"
    >
    <BaseUI:UserControlBase.Resources>
        <Style x:Key="CommentsButton" TargetType="Button">
            <Setter Property="Background" Value="#FF1F3B53"/>
            <Setter Property="Foreground" Value="#FF000000"/>
            <Setter Property="Padding" Value="3"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="BorderBrush">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#FFA3AEB9" Offset="0"/>
                        <GradientStop Color="#FF8399A9" Offset="0.375"/>
                        <GradientStop Color="#FF718597" Offset="0.375"/>
                        <GradientStop Color="#FF617584" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Button">
                        <Grid>
                            <VisualStateManager.VisualStateGroups>
                                <VisualStateGroup x:Name="CommonStates">
                                    <VisualState x:Name="Normal"/>
                                    <VisualState x:Name="MouseOver">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FFB4C2DA"/>
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Pressed">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value="1"/>
                                            </DoubleAnimationUsingKeyFrames>
                                            <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="BackgroundAnimation" Storyboard.TargetProperty="(Border.Background).(GradientBrush.GradientStops)[0].(GradientStop.Color)">
                                                <EasingColorKeyFrame KeyTime="00:00:00" Value="#FF94B0E0"/>
                                            </ColorAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                    <VisualState x:Name="Disabled">
                                        <Storyboard>
                                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="DisabledVisualElement" Storyboard.TargetProperty="Opacity">
                                                <SplineDoubleKeyFrame KeyTime="0" Value=".55"/>
                                            </DoubleAnimationUsingKeyFrames>
                                        </Storyboard>
                                    </VisualState>
                                </VisualStateGroup>
                                <VisualStateGroup x:Name="FocusStates">
                                    <VisualState x:Name="Focused"/>
                                    <VisualState x:Name="Unfocused"/>
                                </VisualStateGroup>
                            </VisualStateManager.VisualStateGroups>
                            <Border x:Name="Background" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3,3,27,27">
                                <Border.Background>
                                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                        <GradientStop Color="#FFB6C9FA" Offset="0"/>
                                        <GradientStop Color="White" Offset="1"/>
                                        <GradientStop Color="#FFD9E3FC" Offset="0.181"/>
                                    </LinearGradientBrush>
                                </Border.Background>
                                <Grid Margin="1">
                                    <Border x:Name="BackgroundAnimation" Opacity="0" CornerRadius="3,3,27,27">
                                        <Border.Background>
                                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                                <GradientStop Color="#FF7099E0" Offset="0"/>
                                                <GradientStop Color="White" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.Background>
                                    </Border>
                                    <Rectangle x:Name="BackgroundGradient"/>
                                </Grid>
                            </Border>
                            <ContentPresenter x:Name="contentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
                            <Rectangle x:Name="DisabledVisualElement" Fill="#FFFFFFFF" RadiusX="3" RadiusY="3" IsHitTestVisible="false" Opacity="0"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </BaseUI:UserControlBase.Resources>
    <Grid x:Name="LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="CommentsStates">
                <VisualStateGroup.Transitions>
                	<VisualTransition GeneratedDuration="00:00:00">
                		<VisualTransition.GeneratedEasingFunction>
                			<CircleEase EasingMode="EaseInOut"/>
                		</VisualTransition.GeneratedEasingFunction>
                	</VisualTransition>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Expanded">
                	<Storyboard>
                		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                			<EasingDoubleKeyFrame KeyTime="00:00:00" Value="180"/>
                		</DoubleAnimationUsingKeyFrames>
                		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                			<EasingDoubleKeyFrame KeyTime="00:00:00" Value="-180"/>
                		</DoubleAnimationUsingKeyFrames>
                		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="contentControl" Storyboard.TargetProperty="(UIElement.Opacity)">
                			<EasingDoubleKeyFrame KeyTime="00:00:00.6000000" Value="1"/>
                		</DoubleAnimationUsingKeyFrames>
                		<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="contentControl" Storyboard.TargetProperty="(UIElement.Visibility)" Duration="00:00:00.0010000">
                			<DiscreteObjectKeyFrame KeyTime="00:00:00">
                				<DiscreteObjectKeyFrame.Value>
                					<Visibility>Visible</Visibility>
                				</DiscreteObjectKeyFrame.Value>
                			</DiscreteObjectKeyFrame>
                		</ObjectAnimationUsingKeyFrames>
                	</Storyboard>
                </VisualState>
                <VisualState x:Name="Collapsed">
                	<Storyboard>
                		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                			<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                		</DoubleAnimationUsingKeyFrames>
                		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Duration="00:00:00.0010000" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                			<EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
                		</DoubleAnimationUsingKeyFrames>
                		<DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="contentControl" Storyboard.TargetProperty="(UIElement.Opacity)">
                			<EasingDoubleKeyFrame KeyTime="00:00:00.7000000" Value="0"/>
                		</DoubleAnimationUsingKeyFrames>
                		<ObjectAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="contentControl" Storyboard.TargetProperty="(UIElement.Visibility)">
                			<DiscreteObjectKeyFrame KeyTime="00:00:00.7000000">
                				<DiscreteObjectKeyFrame.Value>
                					<Visibility>Collapsed</Visibility>
                				</DiscreteObjectKeyFrame.Value>
                			</DiscreteObjectKeyFrame>
                		</ObjectAnimationUsingKeyFrames>
                	</Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <StackPanel Margin="20"> <!--Margin="0,0,0,65"-->
            <local:BlogPostWidget VerticalAlignment="Stretch" d:LayoutOverrides="Width" />
            <Border BorderBrush="#FFDBDBDC" BorderThickness="1" CornerRadius="0,0,30,30">
                <Border BorderBrush="#FFDBDBDC" BorderThickness="1" CornerRadius="0,0,30,30" Margin="2" >
                    <StackPanel>
                        <Button FontFamily="Trebuchet MS" FontSize="21.333" Margin="0,0,2,2" Style="{StaticResource CommentsButton}"
									Commands:Click.Command="{Binding ExapndCommentButton}" Background="#FF31506A">
                            <Grid Height="32" HorizontalAlignment="Center" VerticalAlignment="Bottom" Width="210">
                                <TextBlock Height="29" VerticalAlignment="Bottom" TextWrapping="Wrap" Margin="34,0" Text="{Binding CountComments}" HorizontalAlignment="Center"/>
                                <Image x:Name="image" HorizontalAlignment="Left" Margin="0,0,0,-1" Width="20" Source="DoubleDownArrow.png" RenderTransformOrigin="0.5,0.5">
                                    <Image.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform/>
                                            <SkewTransform/>
                                            <RotateTransform/>
                                            <TranslateTransform/>
                                        </TransformGroup>
                                    </Image.RenderTransform>
                                </Image>
                                <Image x:Name="image1" HorizontalAlignment="Right" Margin="0,0,0,-1" Width="20" Source="DoubleDownArrow.png" RenderTransformOrigin="0.5,0.5">
                                    <Image.RenderTransform>
                                        <TransformGroup>
                                            <ScaleTransform/>
                                            <SkewTransform/>
                                            <RotateTransform/>
                                            <TranslateTransform/>
                                        </TransformGroup>
                                    </Image.RenderTransform>
                                </Image>
                            </Grid>
                        </Button>
                    	<ContentControl x:Name="contentControl"
							Content="{Binding CommentsControl}"
							HorizontalAlignment="Stretch" Opacity="0" />
                    </StackPanel>
                </Border>
            </Border>
        </StackPanel>
    </Grid>
</BaseUI:UserControlBase>